package cn.piesat.client.service;

import cn.piesat.client.constant.cache.LocalCache;
import cn.piesat.client.model.dto.base.task.DefaultRequestDto;
import cn.piesat.client.model.dto.buiness.QsClientRunnerDto;
import cn.piesat.client.service.impl.QsClientRecord;
import cn.piesat.client.service.impl.QsProcessIntf;
import cn.piesat.client.utils.FTPUtil;
import cn.piesat.client.utils.ProcCmd;
import cn.piesat.client.utils.SenderETTP;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;


@Service
public class ClientContext {

    @Autowired
    private QsProcessIntf clientProcessIntf;

    @Autowired
    private QsClientRecord recordService;
    @Autowired
    private FTPUtil ftpUtil;


    private static final Logger logger = LoggerFactory.getLogger(ClientContext.class);

    @Autowired
    private KafkaTemplate<String, String> kafkaTemplate;

    @Autowired
    private SenderETTP senderETTP;
    @Value("${spring.kafka.producer.enterdata.topic}")
    private String enterDataTopic;
    /**
     * 湖泊结果topic
     */
    @Value("${spring.kafka.lake.enterdata.topic}")
    private String lakeEnterTopic;
    @Value("${spring.kafka.sourcedata.enterdata.topic}")
    private String sourceDataTopic;




//    @Value("${ftpUplpadPath}")
//    private String ftpUplpadPath;

    @Async("kafkaTaskThreadPool")
    public void doProcess(String json) {
        DefaultRequestDto defaultRequestDto = null;
        //1.获取对象
        try {
            defaultRequestDto = JSON.parseObject(json, DefaultRequestDto.class);
        } catch (Exception e) {
            logger.error("[消息转换异常] 消息内容:{}", json);
        }
        try {
            if (defaultRequestDto != null) {
                Gson gson = new Gson();
                QsClientRunnerDto defaultClientRunnerDto = clientProcessIntf.beforeProcess(defaultRequestDto);

                //2.获得到执行命令
                String cmd = clientProcessIntf.spliceCommand(defaultClientRunnerDto);
                //执行
                if (StringUtils.isNotBlank(cmd)) {
                    //记录开始
                    recordService.doRunRecord(defaultClientRunnerDto);
                    LocalCache.taskRunnerCache.put(String.format("%s:%s:%s", defaultClientRunnerDto.getTaskId(), defaultClientRunnerDto.getAlgorithmIdentify(), defaultClientRunnerDto.getFileName()), defaultClientRunnerDto);
                    logger.info("执行命令:{}", cmd);
                    ProcCmd pc = new ProcCmd();
                    pc.execByTimeoutShell(cmd);
                    //3.封装并返回算法结果
                    String resultJson = clientProcessIntf.spliceResultJson(defaultClientRunnerDto);
                    //记录开始
                    recordService.deEndRecord(defaultClientRunnerDto, resultJson);

                    // SWAPDSTDET 标识
                    String adsType = defaultRequestDto.getBasic().getAlgorithmIdentify();
                    String fileName = defaultRequestDto.getBasic().getMainFileName().substring(0, defaultRequestDto.getBasic().getMainFileName().lastIndexOf("."));
                    String fileDate = defaultRequestDto.getBasic().getFileDate();

                    //算法执行成功结果返回
                    JSONObject allParam = JSON.parseObject(resultJson);
                    String algorithmResultsJson = allParam.getJSONObject("algorithmResultsJson").toJSONString();
                    //校验结果字段，如下情况不会入库：算法返回resultJson为空，状态字段status、文件信息数组result，预处理产品preprocess=true时
                    if (StringUtils.isBlank(algorithmResultsJson)) {
                        return;
                    }
                    try {
                        if ("LAKE_WATER".equals(adsType)){
                            kafkaTemplate.send(lakeEnterTopic, fileName + "_" + fileDate, algorithmResultsJson);
                        }else {
                            kafkaTemplate.send(enterDataTopic, fileName + "_" + fileDate, algorithmResultsJson);
                        }

                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
                //4.执行完毕后序处理
                clientProcessIntf.afterProcess(defaultClientRunnerDto);
            }
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("[客户端处理异常] {}", e.getMessage());
        } finally {
            logger.info("[算法执行结束]");
            LocalCache.kafkaListenerPoolLock.toEnd();
        }

    }

    @Async("kafkaTaskThread01Pool")
    public void doProcess01(String json) {
        DefaultRequestDto defaultRequestDto = null;
        //1.获取对象
        try {
            defaultRequestDto = JSON.parseObject(json, DefaultRequestDto.class);
        } catch (Exception e) {
            logger.error("[消息转换异常] 消息内容:{}", json);
        }
        try {
            if (defaultRequestDto != null) {
                Gson gson = new Gson();
                QsClientRunnerDto defaultClientRunnerDto = clientProcessIntf.beforeProcess(defaultRequestDto);

                //2.获得到执行命令
                String cmd = clientProcessIntf.spliceCommand(defaultClientRunnerDto);
                //执行
                if (StringUtils.isNotBlank(cmd)) {
                    //记录开始
                    recordService.doRunRecord(defaultClientRunnerDto);
                    LocalCache.taskRunnerCache.put(String.format("%s:%s:%s", defaultClientRunnerDto.getTaskId(), defaultClientRunnerDto.getAlgorithmIdentify(), defaultClientRunnerDto.getFileName()), defaultClientRunnerDto);
                    logger.info("执行命令:{}", cmd);
                    ProcCmd pc = new ProcCmd();
                    pc.execByTimeoutShell(cmd);
                    //3.封装并返回算法结果
                    String resultJson = clientProcessIntf.spliceResultJson(defaultClientRunnerDto);
                    //记录开始
                    recordService.deEndRecord(defaultClientRunnerDto, resultJson);

                    // SWAPDSTDET 标识
                    String adsType = defaultRequestDto.getBasic().getAlgorithmIdentify();
                    String fileName = defaultRequestDto.getBasic().getMainFileName().substring(0, defaultRequestDto.getBasic().getMainFileName().lastIndexOf("."));
                    String fileDate = defaultRequestDto.getBasic().getFileDate();

                    //算法执行成功结果返回
                    JSONObject allParam = JSON.parseObject(resultJson);
                    String algorithmResultsJson = allParam.getJSONObject("algorithmResultsJson").toJSONString();
                    //校验结果字段，如下情况不会入库：算法返回resultJson为空，状态字段status、文件信息数组result，预处理产品preprocess=true时
                    if (StringUtils.isBlank(algorithmResultsJson)) {
                        return;
                    }
                    try {
                        kafkaTemplate.send(enterDataTopic, fileName + "_" + fileDate, algorithmResultsJson);
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
                //4.执行完毕后序处理
                clientProcessIntf.afterProcess(defaultClientRunnerDto);
            }
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("[客户端处理异常] {}", e.getMessage());
        } finally {
            logger.info("[算法执行结束]");
            LocalCache.kafkaListenerPoolLock01.toEnd();
        }

    }

    public static void main(String[] args) {
        String algorithmResultsJson = a();


    }

    static String a() {
        return "{\n" +
                "  \"result\": [\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"ALLC\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_CHN-_ALLC_1000M.PNG\",\n" +
                "      \"module\": \"vegetation \",\n" +
                "      \"region\": \"CHN-\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"ALLC\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_CHN-_ALLC_1000M.TIFF\",\n" +
                "      \"module\": \"vegetation \",\n" +
                "      \"region\": \"CHN-\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"CROP\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_CHN-_CROP_1000M.PNG\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"CHN-\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"CROP\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_CHN-_CROP_1000M.TIFF\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"CHN-\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_CHN-_WHEAT_1000M.PNG\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"CHN-\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_CHN-_WHEAT_1000M.TIFF\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"CHN-\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_HE--_WHEAT_1000M.PNG\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"HE--\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_HE--_WHEAT_1000M.TIFF\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"HE--\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_SD--_WHEAT_1000M.PNG\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"SD--\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_SD--_WHEAT_1000M.TIFF\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"SD--\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_HA--_WHEAT_1000M.PNG\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"HA--\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_HA--_WHEAT_1000M.TIFF\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"HA--\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_AH--_WHEAT_1000M.PNG\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"AH--\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_AH--_WHEAT_1000M.TIFF\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"AH--\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_SX--_WHEAT_1000M.PNG\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"SX--\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_SX--_WHEAT_1000M.TIFF\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"SX--\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_SN--_WHEAT_1000M.PNG\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"SN--\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_SN--_WHEAT_1000M.TIFF\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"SN--\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_BJ--_WHEAT_1000M.PNG\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"BJ--\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_BJ--_WHEAT_1000M.TIFF\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"BJ--\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_TJ--_WHEAT_1000M.PNG\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"TJ--\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_TJ--_WHEAT_1000M.TIFF\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"TJ--\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_JS--_WHEAT_1000M.PNG\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"JS--\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_JS--_WHEAT_1000M.TIFF\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"JS--\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_HB--_WHEAT_1000M.PNG\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"HB--\",\n" +
                "      \"productFormat\": \"PNG\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"WHEAT\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_HB--_WHEAT_1000M.TIFF\",\n" +
                "      \"module\": \"crops\",\n" +
                "      \"region\": \"HB--\",\n" +
                "      \"productFormat\": \"TIFF\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"productIdCHN\": \"NDVI01\",\n" +
                "      \"landclass\": \"ALLC\",\n" +
                "      \"filePath\": \"//FY3D/NDVI01/2022/20221129ROTD/FY3D_MERSI_GLL_NDVI01_20221129_ROTD_CHN-_ALLC_1000M.xlsx\",\n" +
                "      \"module\": \"vegetation \",\n" +
                "      \"region\": \"CHN-\",\n" +
                "      \"productFormat\": \"xlsx\",\n" +
                "      \"productIdENG\": \"NDVI01\"\n" +
                "    }\n" +
                "  ],\n" +
                "  \"period\": \"ROTD\",\n" +
                "  \"stats\": {\n" +
                "    \"area\": {\n" +
                "      \"河南省冬小麦区\": [\n" +
                "        14,\n" +
                "        804,\n" +
                "        18227,\n" +
                "        36692,\n" +
                "        3794\n" +
                "      ],\n" +
                "      \"中国植被区\": [\n" +
                "        200464,\n" +
                "        876046,\n" +
                "        7036593,\n" +
                "        1291627,\n" +
                "        164738\n" +
                "      ],\n" +
                "      \"等级\\\\单位:平方公里\": [\n" +
                "        \"偏差\",\n" +
                "        \"略偏差\",\n" +
                "        \"持平\",\n" +
                "        \"略偏好\",\n" +
                "        \"偏好\"\n" +
                "      ],\n" +
                "      \"湖北省冬小麦区\": [\n" +
                "        119,\n" +
                "        2120,\n" +
                "        5633,\n" +
                "        2879,\n" +
                "        24\n" +
                "      ],\n" +
                "      \"河北省冬小麦区\": [\n" +
                "        0,\n" +
                "        12,\n" +
                "        1640,\n" +
                "        19779,\n" +
                "        3625\n" +
                "      ],\n" +
                "      \"中国冬小麦区\": [\n" +
                "        602,\n" +
                "        14015,\n" +
                "        76439,\n" +
                "        104276,\n" +
                "        15112\n" +
                "      ],\n" +
                "      \"山东省冬小麦区\": [\n" +
                "        19,\n" +
                "        417,\n" +
                "        7743,\n" +
                "        28491,\n" +
                "        7204\n" +
                "      ],\n" +
                "      \"安徽省冬小麦区\": [\n" +
                "        183,\n" +
                "        5400,\n" +
                "        18600,\n" +
                "        5401,\n" +
                "        122\n" +
                "      ],\n" +
                "      \"山西省冬小麦区\": [\n" +
                "        0,\n" +
                "        260,\n" +
                "        3294,\n" +
                "        2171,\n" +
                "        42\n" +
                "      ],\n" +
                "      \"中国农区\": [\n" +
                "        59333,\n" +
                "        210416,\n" +
                "        687960,\n" +
                "        281903,\n" +
                "        29874\n" +
                "      ],\n" +
                "      \"北京市冬小麦区\": [\n" +
                "        0,\n" +
                "        0,\n" +
                "        58,\n" +
                "        22,\n" +
                "        0\n" +
                "      ],\n" +
                "      \"陕西省冬小麦区\": [\n" +
                "        200,\n" +
                "        2478,\n" +
                "        6142,\n" +
                "        1622,\n" +
                "        1\n" +
                "      ],\n" +
                "      \"江苏省冬小麦区\": [\n" +
                "        67,\n" +
                "        2522,\n" +
                "        14868,\n" +
                "        6707,\n" +
                "        293\n" +
                "      ],\n" +
                "      \"天津市冬小麦区\": [\n" +
                "        0,\n" +
                "        2,\n" +
                "        239,\n" +
                "        513,\n" +
                "        7\n" +
                "      ]\n" +
                "    },\n" +
                "    \"percent\": {\n" +
                "      \"河南省冬小麦区\": [\n" +
                "        0.023517159127177438,\n" +
                "        1.35055685273219,\n" +
                "        30.617661386504512,\n" +
                "        61.63511447817104,\n" +
                "        6.373150123465085\n" +
                "      ],\n" +
                "      \"中国植被区\": [\n" +
                "        2.0948290960375227,\n" +
                "        9.154594591883269,\n" +
                "        73.53170521078079,\n" +
                "        13.497375193688928,\n" +
                "        1.7214959076094931\n" +
                "      ],\n" +
                "      \"湖北省冬小麦区\": [\n" +
                "        1.1044083526682134,\n" +
                "        19.675174013921115,\n" +
                "        52.2784222737819,\n" +
                "        26.719257540603248,\n" +
                "        0.22273781902552203\n" +
                "      ],\n" +
                "      \"河北省冬小麦区\": [\n" +
                "        0.0,\n" +
                "        0.04789272030651341,\n" +
                "        6.545338441890166,\n" +
                "        78.93917624521073,\n" +
                "        14.467592592592593\n" +
                "      ],\n" +
                "      \"中国冬小麦区\": [\n" +
                "        0.28606185018342173,\n" +
                "        6.6597289540210225,\n" +
                "        36.32272718632986,\n" +
                "        49.55047423542605,\n" +
                "        7.181007774039649\n" +
                "      ],\n" +
                "      \"山东省冬小麦区\": [\n" +
                "        0.04330583033231527,\n" +
                "        0.9504490130829193,\n" +
                "        17.64826548753248,\n" +
                "        64.93823221042075,\n" +
                "        16.419747458631537\n" +
                "      ],\n" +
                "      \"安徽省冬小麦区\": [\n" +
                "        0.6160371642092507,\n" +
                "        18.17814582912543,\n" +
                "        62.613613411432034,\n" +
                "        18.181512152427118,\n" +
                "        0.4106914428061671\n" +
                "      ],\n" +
                "      \"山西省冬小麦区\": [\n" +
                "        0.0,\n" +
                "        4.508409918501821,\n" +
                "        57.11808565978845,\n" +
                "        37.6452228194902,\n" +
                "        0.7282816022195249\n" +
                "      ],\n" +
                "      \"中国农区\": [\n" +
                "        4.673781357179204,\n" +
                "        16.574897241875846,\n" +
                "        54.19201157003701,\n" +
                "        22.206073954340575,\n" +
                "        2.3532358765673664\n" +
                "      ],\n" +
                "      \"北京市冬小麦区\": [\n" +
                "        0.0,\n" +
                "        0.0,\n" +
                "        72.5,\n" +
                "        27.5,\n" +
                "        0.0\n" +
                "      ],\n" +
                "      \"陕西省冬小麦区\": [\n" +
                "        1.9151584793641674,\n" +
                "        23.728813559322035,\n" +
                "        58.81451690127358,\n" +
                "        15.531935267643398,\n" +
                "        0.009575792396820836\n" +
                "      ],\n" +
                "      \"江苏省冬小麦区\": [\n" +
                "        0.2739501983072331,\n" +
                "        10.31197612135585,\n" +
                "        60.792411170625996,\n" +
                "        27.42364149323302,\n" +
                "        1.1980210164779\n" +
                "      ],\n" +
                "      \"天津市冬小麦区\": [\n" +
                "        0.0,\n" +
                "        0.2628120893561104,\n" +
                "        31.406044678055192,\n" +
                "        67.41130091984232,\n" +
                "        0.9198423127463863\n" +
                "      ],\n" +
                "      \"等级\\\\单位:百分比\": [\n" +
                "        \"偏差\",\n" +
                "        \"略偏差\",\n" +
                "        \"持平\",\n" +
                "        \"略偏好\",\n" +
                "        \"偏好\"\n" +
                "      ]\n" +
                "    }\n" +
                "  },\n" +
                "  \"sensor\": \"MERSI\",\n" +
                "  \"satellite\": \"FY3D\",\n" +
                "  \"message\": \"FY3D_NDVI01_CHN 执行成功 !\",\n" +
                "  \"productDate\": \"20221129\",\n" +
                "  \"productionTime\": \"2022-12-01 02:20:04 CST\",\n" +
                "  \"status\": \"0\",\n" +
                "  \"algorithm\": \"FY3D_NDVI01_CHN_ROTD\"\n" +
                "}";
    }


}
